package com.yiwenup.leetcode.site;

/**
 * https://leetcode-cn.com/problems/richest-customer-wealth/
 **/
public class No1672 {
    /**
     * 执行用时：0 ms, 在所有 Java 提交中击败了100.00%的用户
     * 内存消耗：40.8 MB, 在所有 Java 提交中击败了47.57%的用户
     */
    public int maximumWealth(int[][] accounts) {
        int sum = 0;
        for (int[] account : accounts) {
            int amount = 0;
            for (int amt : account) {
                amount += amt;
            }
            sum = Math.max(sum, amount);
        }
        return sum;
    }
}
